#!/bin/sh #Short Description : Script To Disable Skip In macOS Auto Reboot Prompt After X Max Skip Attempts. #Description : Script To Disable Skip In macOS Auto Reboot Prompt After X Max Skip Attempts. #Script Arguments : #Exit Code : 0 #Category : Patch #Platform : Mac if [ $# -eq 0 ] then echo "Error: Specify max skip attempts" exit 1 fi maxSkipRetry=$1 pwd cd ../../../SystemData/ AutoRebootMaxSkipAttemptsKey="AutoRebootMaxSkipAttempts" val=$(/usr/libexec/PlistBuddy -c 'print ":'$AutoRebootMaxSkipAttemptsKey'"' ./dcmsghandler.plist 2>/dev/null) exitCode=$? if [ $exitCode == 0 ] then /usr/libexec/PlistBuddy -c "Delete :$AutoRebootMaxSkipAttemptsKey" ./dcmsghandler.plist fi /usr/libexec/PlistBuddy -c "Add :$AutoRebootMaxSkipAttemptsKey String $maxSkipRetry" ./dcmsghandler.plist exit $?